package com.frogs.ucenter.service.daoimpl;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.frogs.framework.base.dao.BaseDao;
import com.frogs.framework.base.service.daoimpl.BaseServiceImpl;
import com.frogs.framework.util.PageList;
import com.frogs.ucenter.dao.UserAccountInfoDao;
import com.frogs.ucenter.entity.UserAccountInfo;
import com.frogs.ucenter.entity.UserBaseAccountInfo;
import com.frogs.ucenter.service.UserAccountInfoService;

@Transactional(propagation=Propagation.REQUIRED, rollbackFor=Exception.class) 
@Service("userAccountInfoService")
public class UserAccountInfoServiceImpl extends BaseServiceImpl<UserAccountInfo> implements UserAccountInfoService {
    @Resource
    private UserAccountInfoDao userAccountInfoDao;

    public UserAccountInfoServiceImpl() {
        super();
    }

    public UserAccountInfoDao getUserAccountInfoDao() {
        return userAccountInfoDao;
    }

    /**
     * Don't remove or edit it.
     */
    @Override
    protected BaseDao<UserAccountInfo> getBaseDao() {
        return userAccountInfoDao;
    }

    public void setUserAccountInfoDao(UserAccountInfoDao userAccountInfoDao) {
        this.userAccountInfoDao = userAccountInfoDao;
    }

	@Override
	public PageList<UserBaseAccountInfo> listBaseAccount(
			Map<String, Object> params, int pageNo, int pageSize) {
		
		PageList<UserBaseAccountInfo> list = userAccountInfoDao.listUserAccount(params, pageNo, pageSize);
		return list;
	}

	@Override
	public UserBaseAccountInfo getUserBaseAccountByUserId(int userId) {
		return userAccountInfoDao.selectByUserId(userId);
	}
}